<%@ page language="java" pageEncoding="UTF-8" %>
<%@ include file="../../baselist.jsp" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
</head>

<body>
<form name="icform" method="post">

    <div id="menubar">
        <div id="middleMenubar">
            <div id="innerMenubar">
                <div id="navMenubar">
                    <ul>
                        <li id="view"><a href="#" onclick="formSubmit('toview.action','_self');this.blur();">查看</a></li>
                        <li id="new"><a href="${pageContext.request.contextPath}/contract/jContractCreate"
                                        onclick="formSubmit('tocreate.action','_self');this.blur();">新增</a></li>
                        <li id="update"><a href="#" onclick="formSubmit('toupdate.action','_self');this.blur();">修改</a>
                        </li>
                        <li id="delete"><a href="#" onclick="formSubmit('delete.action','_self');this.blur();">删除</a>
                        </li>
                        <li id="new"><a href="#" onclick="formSubmit('submit.action','_self');this.blur();">上报</a></li>
                        <li id="new"><a href="#" onclick="formSubmit('cancel.action','_self');this.blur();">取消</a></li>
                    </ul>
                </div>
            </div>
        </div>
    </div>

    <div class="textbox" id="centerTextbox">
        <div class="textbox-header">
            <div class="textbox-inner-header">
                <div class="textbox-title">
                    购销合同列表
                </div>
            </div>
        </div>

        <div>

            <div class="eXtremeTable">
                <table id="ec_table" class="tableRegion" width="98%">
                    <thead>
                    <tr>
                        <td class="tableHeader"><input type="checkbox" name="selid" onclick="checkAll('id',this)"></td>
                        <td class="tableHeader">序号</td>
                        <td class="tableHeader">客户名称</td>
                        <td class="tableHeader">合同号</td>
                        <td class="tableHeader">制单人</td>
                        <td class="tableHeader">审单人</td>
                        <td class="tableHeader">验货员</td>
                        <td class="tableHeader">签单日期</td>
                        <td class="tableHeader">交货期限</td>
                        <td class="tableHeader">船期</td>
                        <td class="tableHeader">总金额</td>
                        <td class="tableHeader">状态</td>
                        <td class="tableHeader">操作</td>
                    </tr>
                    </thead>
                    <tbody class="tableBody">

                    <c:forEach items="${o}" var="o" varStatus="status">
                        <tr class="odd" onmouseover="this.className='highlight'" onmouseout="this.className='odd'">
                            <td><input type="checkbox" name="contract_id" value="${o.contract_id}"/></td>
                            <td>${status.index+1}</td>
                            <td>${o.custom_name}</td>
                            <td><a href="toview.action?id=${o.contract_id}">${o.contract_id}</a></td>
                            <td>${o.input_by}</td>
                            <td>${o.check_by}</td>
                            <td>${o.inspector}</td>
                            <td><fmt:formatDate value="${o.signing_date}" pattern="yyyy-MM-dd"/></td>
                            <td><fmt:formatDate value="${o.delivery_period}" pattern="yyyy-MM-dd"/></td>
                            <td><fmt:formatDate value="${o.ship_time}" pattern="yyyy-MM-dd"/></td>
                            <td>${o.total_amount}</td>
                            <td>
                                <c:if test="${o.state==1}"><a
                                        href="${pageContext.request.contextPath}/contract/startC?contract_id=${o.contract_id}"><font
                                        color="green">已上报</font></a></c:if>
                                <c:if test="${o.state==2}"><a
                                        href="${pageContext.request.contextPath}/contract/stopC?contract_id=${o.contract_id}">草稿</a></c:if>
                            </td>
                            <td><a href="${pageContext.request.contextPath}/ConProduct/jContractProductCreate"
                                   title="新增货物信息">[货物]</a></td>
                            <td><a href="${pageContext.request.contextPath}/contract/deleteContract/${o.contract_id}">[删除]</a>
                                <a href="${pageContext.request.contextPath}/contract/jContractProductCreate?id=${o.contract_id}">[修改]</a>
                            </td>
                        </tr>
                    </c:forEach>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</form>
</body>
</html>

